// packageC/pages/takeoutmap/takeoutmap.js
const app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        listData: [{
            "id": 1,
            "placeName": "测试地址1",
            "placeImageUrl": "",
            "placeOpenTime": 1506200400,
            "placeCloseTime": 1506265200,
            "placeAddress": "测试地址1啊",
            "placeLongitude": "114.08190678985596",
            "placeLatitude": "22.544808209639864"
        }, {
            "id": 2,
            "placeName": "测试地址2",
            "placeImageUrl": "",
            "placeOpenTime": 1506200400,
            "placeCloseTime": 1506265200,
            "placeAddress": "测试地址2啊",
            "placeLongitude": "114.0938372555542",
            "placeLatitude": "22.53953655390022"
        }, {
            "id": 3,
            "placeName": "测试地址3",
            "placeImageUrl": "",
            "placeOpenTime": 1506243600,
            "placeCloseTime": 1506265200,
            "placeAddress": "测试地址3啊",
            "placeLongitude": "114.05454",
            "placeLatitude": "22.52291"
        }],
        scale: '15',
        Height: '0',
        controls: '40',
        latitude: '',
        longitude: '',
        markers: [],
    },

    /**
     * 生命周期函数--监听页面加载
     */

    chooseMap() {
        app.getLocation(
            (data) => {
                console.log(data, "iiiiioooop[p[pp")
                this.setData({
                    longitude: data.longitude,
                    latitude: data.latitude
                }, () => {

                })
            },
            (err) => {
                // 定位失败回调
                this.setData({
                    refreshing: false
                })
            })
    },

    chooseMap() {
        app.getLocation(
            (data) => {
                console.log(data, "iiiiioooop[p[pp")
                this.setData({
                    longitude: data.longitude,
                    latitude: data.latitude
                }, () => {

                })
            },
            (err) => {
                // 定位失败回调
                this.setData({
                    refreshing: false
                })
            })
    },


    onLoad(options) {
        this.chooseMap()
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})